﻿define(['jquery', 'sammy', 'masonry'], function ($) {
    return {
        create: function (options) {
            var app = Sammy(function () {
                this.get('#/story/loadall', function () {
                    for (var i = 0; i < 100; ++i) {
                        options.container.append($('<div/>').addClass('box well').text('this is story #' + i));
                    }
                    options.container.masonry({
                        itemSelector: '.box',
                        columnWidth: function (containerWidth) {
                            return containerWidth / 5;
                        }
                    });
                });
            });
            app.run('#/story/loadall');
            return app;
        }
    };
});
